package com.gitee.feizns.utils.convert;

import com.gitee.feizns.utils.jar.JarUtils;
import lombok.NonNull;

/**
 * 类型转换
 * @author feizns
 * @since 2019/5/15
 */
public abstract class ConvertUtils {

    /**
     * 转换为int
     * @param obj
     * @return
     */
    public static final Integer toInt(@NonNull Object obj) {
        String string = obj.toString();
        try {
            return Integer.parseInt(string);
        } catch (NumberFormatException e) {
            return null;
        }
    }

}
